$OpenBSD: patch-nspr_pr_src_misc_prnetdb_c,v 1.2 2016/03/01 21:02:30 landry Exp $
--- nspr/pr/src/misc/prnetdb.c.orig	Fri Feb 12 14:51:25 2016
+++ nspr/pr/src/misc/prnetdb.c	Tue Mar  1 21:13:56 2016
@@ -2043,7 +2043,9 @@ PR_IMPLEMENT(PRAddrInfo *) PR_GetAddrInfoByName(const 
          */
         hints.ai_socktype = SOCK_STREAM;
 
+	LOCK_DNS();
         rv = GETADDRINFO(hostname, NULL, &hints, &res);
+	UNLOCK_DNS();
 #ifdef AI_ADDRCONFIG
         if (rv == EAI_BADFLAGS && (hints.ai_flags & AI_ADDRCONFIG)) {
             hints.ai_flags &= ~AI_ADDRCONFIG;
